package Test6.BOOK;

public class BookList {
    public Book[] books;
    private int usedSize;//记录当前书架放了几本书


    public BookList(){
        this.books = new Book[10];//能放十本书
        books[0] = new Book("三国演义","罗贯中",34,"历史类小说");
        books[1] = new Book("西游记","吴承恩",42,"神魔小说");
        this.usedSize =2;
    }

    public void setBooks(int pos,Book newbook){
        books[pos] = newbook;
    }
    public Book getBooks(int pos) {
        return books[pos];
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

}
